import 'package:flutter/cupertino.dart';
import 'package:imember/UI/Summary/GuanZhang.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Util/PageUtil.dart';
import 'package:imember/Widget/MyButton.dart';
import 'package:imember/Widget/MyPage.dart';

import '../Home.dart';

class SummaryDone extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _SummaryDone();
  }
}

class _SummaryDone extends State {
  @override
  Widget build(BuildContext context) {
    return MyPage(
        Container(
            child: Column(children: [
          Btn("小結完成，繼續營業", () {
            PageUtil().openRemoveAll(context, Home());
          }),
          Btn("小結完成，開始進行關帳", () {
            PageUtil().open(context, GuanZhang());
          })
        ])),
        title: "小結完成");
  }
}

class Btn extends StatelessWidget {
  String txt;
  Function() onTap;

  Btn(this.txt, this.onTap);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        height: 48,
        width: double.infinity,
        margin: EdgeInsets.fromLTRB(35, 22, 35, 0),
        padding: EdgeInsets.only(left: 22),
        alignment: Alignment.centerLeft,
        decoration: BoxDecoration(color: MyColor.Orange, borderRadius: BorderRadius.all(Radius.circular(24))),
        child: Text(txt, style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xFFFFFFFF), fontSize: 24)),
      ),
    );
  }
}
